package com.bestvike.stone.spring.stream.core;

import com.bestvike.stone.spring.rabbit.core.IHandlerAdapter;
import org.springframework.messaging.Message;
import org.springframework.messaging.handler.invocation.InvocableHandlerMethod;

import java.lang.reflect.Method;

/**
 * Created by 许崇雷 on 2018-09-04.
 */
public final class StreamInvocableHandlerMethod extends InvocableHandlerMethod implements IHandlerAdapter {
    public StreamInvocableHandlerMethod(Object bean, Method method) {
        super(bean, method);
    }

    //执行拦截消费
    @Override
    public Object invoke(Message<?> message, Object... providedArgs) {
        return this.invokeCore(this.getMethod().toGenericString(), message, providedArgs);
    }

    @Override
    public Object invokeSuper(Message<?> message, Object... providedArgs) throws Exception {
        return super.invoke(message, providedArgs);
    }
}
